<template>
    <div class="question">
        
    </div >
</template>

<script>
import {getQuestionById,getAnswerListById} from '../api/question';
export default {
    name:"question-component",
    data(){
        return{
            QuestionId:this.$route.query.id,
            question:{
                userId:'',
                content:'',
                createDate:'',
            },
            answerList:[],
            answer:{
                questionId:'',
                userId:'',
                answerText:'',
                createDate:'',
            }
        }
    },
    created(){

    },
    methods:{
        async fetchQuestion(){
            try {
                const response = await getQuestionById(this.QuestionId);
                this.question = response.data;
            } catch (error) {
                console.log('Error fetching Question:',error);
            }
        },
        async fetchAnswer(){
            try {
                const response = await getAnswerListById(this.QuestionId);
                this.answerList = response.data;
            } catch (error) {
                console.log('Error fetching AnswerList',error);
            }
        }
        
    }
}
</script>

<style>

</style>